<template>
  <div class="slot">
    <div class="slot-box">
      <h3><slot name="title"></slot></h3>
      <div class="top-box">
        <div v-show="isNeedConfig" class="config-box">
          <div class="params"><slot name="config"></slot></div>
        </div>
      </div>
      <div class="chart-box">
        <slot name="chart"></slot>
      </div>
      <div class="tools">
        <slot name="type"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    isNeedConfig: {
      type: Boolean
    }
  }
}
</script>

<style lang="scss" scoped>
.slot {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  h3 {
    line-height: 40px;
    padding: 0 20px;
    border-bottom: 1px solid $color142;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: bold;
    color: $color1;
    background-color: $color4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .slot-box {
    flex: 1;
    width: 100%;
    background-color: #fff;
    .top-box {
      position: relative;
      display: flex;
      align-items: flex-start;
      width: 100%;
      margin: 20px 0;
      .config-box {
        flex: 1;
        background-color: #fff;
        .params {
          padding: 0 20px;
        }
        .btn {
          width: 80%;
          height: 36px;
          border-radius: 4px;
          margin: 20px 10%;
          color: #fff;
          background-color: $color141;
          cursor: pointer;
        }
      }
    }
    .tools {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding: 0 20px 20px;
      // margin-bottom: 20px;
      .icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 120px;
        height: 30px;
        border: 1px solid $color141;
        border-radius: 30px;
        box-sizing: border-box;
        margin-left: 16px;
        text-align: center;
        font-size: 14px;
        color: $color6;
        background-color: transparent;
        cursor: pointer;
        &:hover {
          // border-color: $color141;
          // color: #fff;
          // background-color: $color141;
        }
      }
      .btn-group {
        margin-right: 20px;
        .icon {
          border-radius: 0;
          &:first-child {
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
          }
          &:last-child {
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;
          }
          &.active {
            border-color: $color141;
            color: #fff;
            background-color: $color141;
          }
        }
      }
      // .icon2 {
      //   display: inline-block;
      //   height: 32px;
      //   line-height: 32px;
      //   text-align: center;
      //   font-size: 14px;
      //   border: 1px solid $color30;
      //   border-radius: 4px;
      //   box-sizing: border-box;
      //   background-color: transparent;
      //   cursor: pointer;
      //   padding: 0 10px;
      //   margin-left: 10px;
      //   font-size: 13px;
      //   cursor: pointer;
      //   &:hover {
      //     border-color: $color141;
      //     color: #fff;
      //     background-color: $color141;
      //   }
      // }
    }
  }
  .config-box {
    // width: 260px;
    // margin-left: 10px;
    background-color: #fff;
    .params {
      padding: 0 20px;
    }
    .btn {
      width: 80%;
      height: 36px;
      border-radius: 4px;
      margin: 20px 10%;
      color: #fff;
      background-color: $color141;
      cursor: pointer;
    }
  }
}
</style>